<h1><?  echo $item['title']; ?></h1>
<p>Понравилось: <?  echo $item['rating_yes']; ?></p>
<p>Не понравилось: <?  echo $item['rating_no']; ?></h3>
<h3><?  echo $item['price']; ?></h3>
<del><?  echo $item['old_price']; ?></del>
<p>
	<?
		$gallery = $item->getGallery();
		if($gallery){
			foreach($gallery as $image){
				echo CHtml::image(Yii::app()->request->hostInfo.'/images/'.$image,$item['title'],array(
					'height' => '100',
				));
			}
		}
	?>
</p>
<p><?  echo $item['description']; ?></p>
<p>Изображений товара: <?  echo count($item['images']); ?></p>
<?php
	echo "В корзине товаров: ".$item->countInCart();
	if(!Yii::app()->shoppingCart->contains($item->id)){
		echo CHtml::form(Yii::app()->request->hostInfo.'/cart/update','POST');
		echo CHtml::hiddenField('id', base64_encode($item->id));
		echo CHtml::hiddenField('action', base64_encode('add'));
		echo CHtml::hiddenField('fullPath', base64_encode(yiistoAbsolutePath()));
		echo CHtml::ajaxSubmitButton ("Добавить в корзину",CController::createUrl('cart/update'),
			array(
                    'success' => 'function(data){
                        $("#cart").load("'.Yii::app()->request->hostInfo.'/cart/getWidget",{fullPath: "'.base64_encode(yiistoAbsolutePath()).'"});
                        $("#content").load("'.Yii::app()->request->hostInfo.'/item/index/id/'.$item->id.'");
                    }',
			),
			array(
				'id' => 'add_'.$item->id,
			)
		);
		echo CHtml::endForm();
	}else{
		echo CHtml::form(Yii::app()->request->hostInfo.'/cart/update','POST');
		echo CHtml::hiddenField('id', base64_encode($item->id));
		echo CHtml::hiddenField('action', base64_encode('add'));
		echo CHtml::hiddenField('fullPath', base64_encode(yiistoAbsolutePath()));
		echo CHtml::ajaxSubmitButton ("+",CController::createUrl('cart/update'),
			array(
                    'success' => 'function(data){
                        $("#cart").load("'.Yii::app()->request->hostInfo.'/cart/getWidget");
                        $("#content").load("'.Yii::app()->request->hostInfo.'/item/index/id/'.$item->id.'");
                    }',
			),
			array(
				'id' => 'add_'.$item->id,
			)
		);
		echo CHtml::endForm();
		echo CHtml::form(Yii::app()->request->hostInfo.'/cart/update','POST');
		echo CHtml::hiddenField('id', base64_encode($item->id));
		echo CHtml::hiddenField('action', base64_encode('decrement'));
		echo CHtml::hiddenField('fullPath', base64_encode(yiistoAbsolutePath()));
		echo CHtml::ajaxSubmitButton ("-",CController::createUrl('cart/update'),
			array(
                    'success' => 'function(data){
                        $("#cart").load("'.Yii::app()->request->hostInfo.'/cart/getWidget");
                        $("#content").load("'.Yii::app()->request->hostInfo.'/item/index/id/'.$item->id.'");
                    }',
			),
			array(
				'id' => 'add_'.$item->id,
			)
		);
		echo CHtml::endForm();
		echo CHtml::form(Yii::app()->request->hostInfo.'/cart/update','POST');
		echo CHtml::hiddenField('id', base64_encode($item->id));
		echo CHtml::hiddenField('action', base64_encode('remove'));
		echo CHtml::hiddenField('fullPath', base64_encode(yiistoAbsolutePath()));
		echo CHtml::ajaxSubmitButton ("Удалить из корзины",CController::createUrl('cart/update'),
			array(
                    'success' => 'function(data){
                        $("#cart").load("'.Yii::app()->request->hostInfo.'/cart/getWidget");
                        $("#content").load("'.Yii::app()->request->hostInfo.'/item/index/id/'.$item->id.'");
                    }',
			),
			array(
				'id' => 'add_'.$item->id,
			)
		);
		echo CHtml::endForm();
	}
?>